<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.net.http.HttpCookies</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.net.http.HttpCookies";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.net.http.HttpCookies.html" class="symbol">tango.net.http.HttpCookies</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Initial release: April 2004
<p class="sec_header">Author:</p>Kris
<dl>
<dt class="decl">class <a class="symbol _class" name="Cookie" href="./htmlsrc/tango.net.http.HttpCookies.html#L39" kind="class" beg="39" end="232">Cookie</a> : IWritable; <a title="Permalink to this symbol" href="#Cookie" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L39">#</a></dt>
<dd class="ddef">
<div class="summary">Defines the Cookie class, and the means for reading &amp; writing them.
        Cookie implementation conforms with RFC 2109, but supports parsing 
        of server-side cookies only. Client-side cookies are supported in
        terms of output, but response parsing is not yet implemented ...</div>
See over <A HREF="http://www.faqs.org/rfcs/rfc2109.html">here</A>
        for the RFC document.
<dl>
<dt class="decl"><a class="symbol _ctor" name="Cookie.this" href="./htmlsrc/tango.net.http.HttpCookies.html#L58" kind="ctor" beg="58" end="58">this</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Cookie.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L58">#</a></dt>
<dd class="ddef">
<div class="summary">Construct an empty client-side cookie. You add these
                to an output request using HttpClient.addCookie(), or
                the equivalent.</div></dd>
<dt class="decl"><a class="symbol _ctor" name="Cookie.this:2" href="./htmlsrc/tango.net.http.HttpCookies.html#L68" kind="ctor" beg="68" end="72">this</a><span class="params">(char[] <em>name</em>, char[] <em>value</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L68">#</a></dt>
<dd class="ddef">
<div class="summary">Construct a cookie with the provided attributes. You add 
                these to an output request using HttpClient.addCookie(), 
                or the equivalent.</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setName" href="./htmlsrc/tango.net.http.HttpCookies.html#L80" kind="function" beg="80" end="84">setName</a><span class="params">(char[] <em>name</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setName" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L80">#</a></dt>
<dd class="ddef">
<div class="summary">Set the name of this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setValue" href="./htmlsrc/tango.net.http.HttpCookies.html#L92" kind="function" beg="92" end="96">setValue</a><span class="params">(char[] <em>value</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setValue" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L92">#</a></dt>
<dd class="ddef">
<div class="summary">Set the value of this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setVersion" href="./htmlsrc/tango.net.http.HttpCookies.html#L104" kind="function" beg="104" end="108">setVersion</a><span class="params">(uint <em>vrsn</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setVersion" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L104">#</a></dt>
<dd class="ddef">
<div class="summary">Set the version of this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setPath" href="./htmlsrc/tango.net.http.HttpCookies.html#L116" kind="function" beg="116" end="120">setPath</a><span class="params">(char[] <em>path</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setPath" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L116">#</a></dt>
<dd class="ddef">
<div class="summary">Set the path of this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setDomain" href="./htmlsrc/tango.net.http.HttpCookies.html#L128" kind="function" beg="128" end="132">setDomain</a><span class="params">(char[] <em>domain</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setDomain" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L128">#</a></dt>
<dd class="ddef">
<div class="summary">Set the domain of this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setComment" href="./htmlsrc/tango.net.http.HttpCookies.html#L140" kind="function" beg="140" end="144">setComment</a><span class="params">(char[] <em>comment</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setComment" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L140">#</a></dt>
<dd class="ddef">
<div class="summary">Set the comment associated with this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setMaxAge" href="./htmlsrc/tango.net.http.HttpCookies.html#L152" kind="function" beg="152" end="156">setMaxAge</a><span class="params">(long <em>maxAge</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setMaxAge" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L152">#</a></dt>
<dd class="ddef">
<div class="summary">Set the maximum duration of this cookie</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.setSecure" href="./htmlsrc/tango.net.http.HttpCookies.html#L164" kind="function" beg="164" end="168">setSecure</a><span class="params">(bool <em>secure</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.setSecure" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L164">#</a></dt>
<dd class="ddef">
<div class="summary">Indicate whether this cookie should be considered secure or not</div></dd>
<dt class="decl">void <a class="symbol _function" name="Cookie.write" href="./htmlsrc/tango.net.http.HttpCookies.html#L176" kind="function" beg="176" end="179">write</a><span class="params">(IWriter <em>writer</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.write" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L176">#</a></dt>
<dd class="ddef">
<div class="summary">Output the cookie as a text stream, via the provided IWriter</div></dd>
<dt class="decl">void <a class="symbol _function" name="Cookie.produce" href="./htmlsrc/tango.net.http.HttpCookies.html#L187" kind="function" beg="187" end="216">produce</a><span class="params">(void delegate(void[]) <em>consume</em>)</span>; <a title="Permalink to this symbol" href="#Cookie.produce" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L187">#</a></dt>
<dd class="ddef">
<div class="summary">Output the cookie as a text stream, via the provided consumer</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="Cookie.clear" href="./htmlsrc/tango.net.http.HttpCookies.html#L224" kind="function" beg="224" end="231">clear</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Cookie.clear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L224">#</a></dt>
<dd class="ddef">
<div class="summary">Reset this cookie</div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="CookieStack" href="./htmlsrc/tango.net.http.HttpCookies.html#L244" kind="class" beg="244" end="315">CookieStack</a>; <a title="Permalink to this symbol" href="#CookieStack" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L244">#</a></dt>
<dd class="ddef">
<div class="summary">Implements a stack of cookies. Each cookie is pushed onto the
        stack by a parser, which takes its input from HttpHeaders. The
        stack can be populated for both client and server side cookies.</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="CookieStack.this" href="./htmlsrc/tango.net.http.HttpCookies.html#L256" kind="ctor" beg="256" end="260">this</a><span class="params">(int <em>size</em>)</span>; <a title="Permalink to this symbol" href="#CookieStack.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L256">#</a></dt>
<dd class="ddef">
<div class="summary">Construct a cookie stack with the specified initial extent.
                The stack will grow as necessary over time.</div></dd>
<dt class="decl">void <a class="symbol _function" name="CookieStack.reset" href="./htmlsrc/tango.net.http.HttpCookies.html#L268" kind="function" beg="268" end="271">reset</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#CookieStack.reset" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L268">#</a></dt>
<dd class="ddef">
<div class="summary">Pop the stack all the way to zero</div></dd>
<dt class="decl">Cookie <a class="symbol _function" name="CookieStack.push" href="./htmlsrc/tango.net.http.HttpCookies.html#L279" kind="function" beg="279" end="284">push</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#CookieStack.push" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L279">#</a></dt>
<dd class="ddef">
<div class="summary">Return a fresh cookie from the stack</div></dd>
<dt class="decl">void <a class="symbol _function" name="CookieStack.resize" href="./htmlsrc/tango.net.http.HttpCookies.html#L292" kind="function" beg="292" end="298">resize</a><span class="params">(inout Cookie[] <em>cookies</em>, int <em>size</em>)</span>; <span class="attrs">[<span class="prot">private</span>, <span class="stc">static</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#CookieStack.resize" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L292">#</a></dt>
<dd class="ddef">
<div class="summary">Resize the stack such that it has more room.</div></dd>
<dt class="decl">int <a class="symbol _function" name="CookieStack.opApply" href="./htmlsrc/tango.net.http.HttpCookies.html#L306" kind="function" beg="306" end="314">opApply</a><span class="params">(int delegate(inout Cookie) <em>dg</em>)</span>; <a title="Permalink to this symbol" href="#CookieStack.opApply" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L306">#</a></dt>
<dd class="ddef">
<div class="summary">Iterate over all cookies in stack</div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="HttpCookiesView" href="./htmlsrc/tango.net.http.HttpCookies.html#L328" kind="class" beg="328" end="406">HttpCookiesView</a> : IWritable; <a title="Permalink to this symbol" href="#HttpCookiesView" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L328">#</a></dt>
<dd class="ddef">
<div class="summary">This is the support point for server-side cookies. It wraps a
        CookieStack together with a set of HttpHeaders, along with the
        appropriate cookie parser. One would do something very similar
        for client side cookie parsing also.</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="HttpCookiesView.this" href="./htmlsrc/tango.net.http.HttpCookies.html#L341" kind="ctor" beg="341" end="350">this</a><span class="params">(HttpHeadersView <em>headers</em>)</span>; <a title="Permalink to this symbol" href="#HttpCookiesView.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L341">#</a></dt>
<dd class="ddef">
<div class="summary">Construct cookie wrapper with the provided headers.</div></dd>
<dt class="decl">void <a class="symbol _function" name="HttpCookiesView.write" href="./htmlsrc/tango.net.http.HttpCookies.html#L358" kind="function" beg="358" end="361">write</a><span class="params">(IWriter <em>writer</em>)</span>; <a title="Permalink to this symbol" href="#HttpCookiesView.write" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L358">#</a></dt>
<dd class="ddef">
<div class="summary">Output each of the cookies parsed to the provided IWriter.</div></dd>
<dt class="decl">void <a class="symbol _function" name="HttpCookiesView.produce" href="./htmlsrc/tango.net.http.HttpCookies.html#L369" kind="function" beg="369" end="373">produce</a><span class="params">(void delegate (void[]) <em>consume</em>, char[] <em>eol</em> = HttpConst.Eol)</span>; <a title="Permalink to this symbol" href="#HttpCookiesView.produce" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L369">#</a></dt>
<dd class="ddef">
<div class="summary">Output the token list to the provided consumer</div></dd>
<dt class="decl">void <a class="symbol _function" name="HttpCookiesView.reset" href="./htmlsrc/tango.net.http.HttpCookies.html#L381" kind="function" beg="381" end="385">reset</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#HttpCookiesView.reset" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L381">#</a></dt>
<dd class="ddef">
<div class="summary">Reset these cookies for another parse</div></dd>
<dt class="decl">CookieStack <a class="symbol _function" name="HttpCookiesView.parse" href="./htmlsrc/tango.net.http.HttpCookies.html#L394" kind="function" beg="394" end="405">parse</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#HttpCookiesView.parse" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L394">#</a></dt>
<dd class="ddef">
<div class="summary">Parse all cookies from our HttpHeaders, pushing each onto
                the CookieStack as we go.</div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="HttpCookies" href="./htmlsrc/tango.net.http.HttpCookies.html#L417" kind="class" beg="417" end="447">HttpCookies</a>; <a title="Permalink to this symbol" href="#HttpCookies" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L417">#</a></dt>
<dd class="ddef">
<div class="summary">Handles a set of output cookies by writing them into the list of
        output headers.</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="HttpCookies.this" href="./htmlsrc/tango.net.http.HttpCookies.html#L430" kind="ctor" beg="430" end="434">this</a><span class="params">(HttpHeaders <em>headers</em>, HttpHeaderName <em>name</em> = HttpHeader.SetCookie)</span>; <a title="Permalink to this symbol" href="#HttpCookies.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L430">#</a></dt>
<dd class="ddef">
<div class="summary">Construct an output cookie wrapper upon the provided 
                output headers. Each cookie added is converted to an
                addition to those headers.</div></dd>
<dt class="decl">void <a class="symbol _function" name="HttpCookies.add" href="./htmlsrc/tango.net.http.HttpCookies.html#L442" kind="function" beg="442" end="446">add</a><span class="params">(Cookie <em>cookie</em>)</span>; <a title="Permalink to this symbol" href="#HttpCookies.add" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L442">#</a></dt>
<dd class="ddef">
<div class="summary">Add a cookie to our output headers.</div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="CookieParser" href="./htmlsrc/tango.net.http.HttpCookies.html#L457" kind="class" beg="457" end="697">CookieParser</a> : StreamIterator!(char); <a title="Permalink to this symbol" href="#CookieParser" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L457">#</a></dt>
<dd class="ddef">
<div class="summary">Server-side cookie parser. See RFC 2109 for details.</div>
<dl>
<dt class="decl">static <a class="symbol _sctor" name="CookieParser.this" href="./htmlsrc/tango.net.http.HttpCookies.html#L471" kind="sctor" beg="471" end="490">this</a>(); <a title="Permalink to this symbol" href="#CookieParser.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L471">#</a></dt>
<dd class="ddef">
<div class="summary">populate a map of token separators</div></dd>
<dt class="decl"><a class="symbol _ctor" name="CookieParser.this:2" href="./htmlsrc/tango.net.http.HttpCookies.html#L496" kind="ctor" beg="496" end="501">this</a><span class="params">(CookieStack <em>stack</em>)</span>; <a title="Permalink to this symbol" href="#CookieParser.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L496">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">uint <a class="symbol _function" name="CookieParser.scan" href="./htmlsrc/tango.net.http.HttpCookies.html#L510" kind="function" beg="510" end="647">scan</a><span class="params">(void[] <em>data</em>)</span>; <span class="attrs">[<span class="prot">protected</span>]</span> <a title="Permalink to this symbol" href="#CookieParser.scan" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L510">#</a></dt>
<dd class="ddef">
<div class="summary">Callback for iterator.next(). We scan for name-value
                pairs, populating Cookie instances along the way.</div></dd>
<dt class="decl">bool <a class="symbol _function" name="CookieParser.parse" href="./htmlsrc/tango.net.http.HttpCookies.html#L667" kind="function" beg="667" end="671">parse</a><span class="params">(char[] <em>header</em>)</span>; <a title="Permalink to this symbol" href="#CookieParser.parse" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L667">#</a></dt>
<dd class="ddef">
<div class="summary">Locate the next token from the provided buffer, and map a
                buffer reference into token. Returns true if a token was 
                located, false otherwise.</div>
Note that the buffer content is not duplicated. Instead, a
                slice of the buffer is referenced by the token. You can use
                Token.clone() or Token.toString().dup() to copy content per
                your application needs.
<p class="bl"/>
                Note also that there may still be one token left in a buffer 
                that was not terminated correctly (as in eof conditions). In 
                such cases, tokens are mapped onto remaining content and the 
                buffer will have no more readable content.</dd>
<dt class="decl">char[] <a class="symbol _function" name="CookieParser.toLower" href="./htmlsrc/tango.net.http.HttpCookies.html#L679" kind="function" beg="679" end="685">toLower</a><span class="params">(inout char[] <em>src</em>)</span>; <span class="attrs">[<span class="stc">static</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#CookieParser.toLower" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L679">#</a></dt>
<dd class="ddef">
<div class="summary">in-place conversion to lowercase</div></dd>
<dt class="decl">bool <a class="symbol _function" name="CookieParser.isToken" href="./htmlsrc/tango.net.http.HttpCookies.html#L693" kind="function" beg="693" end="696">isToken</a><span class="params">(char <em>c</em>)</span>; <span class="attrs">[<span class="prot">private</span>, <span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#CookieParser.isToken" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.HttpCookies.html#L693">#</a></dt>
<dd class="ddef">
<div class="summary">Is 'c' a valid token character?</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2004 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:03:57 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>